<script lang="ts" setup>
import type { SelectProps } from 'ant-design-vue';

import { ref } from 'vue';

import { Select, Table } from 'ant-design-vue';

const dataSource = ref([
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    dataIndex: '1',
    address: 'New York No. 1 Lake Park',
  },
  {
    key: '2',
    name: 'Jim Green',
    age: 42,
    dataIndex: '2',
    address: 'London No. 1 Lake Park',
  },
]);
const columns: Array<{ dataIndex: string; key: string; title: string }> = [
  {
    title: '序号',
    dataIndex: '1',
    key: 'name',
  },
  {
    title: '客户名',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '机构名称',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '状态',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '记账会计',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '主管会计',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '记账',
    dataIndex: 'address',
    key: 'operation',
    slotName: 'action',
  },
];
const value1 = ref('全部服务类型');
const size = ref<SelectProps['size']>('middle');
const options = ref([
  { label: '全部服务类型', value: '0' },
  { label: '正常服务', value: '1' },
  { label: '停止服务', value: '2' },
]);
// 查询搜索
const value = ref('');
const onSearch = (value: string) => {
  console.log('Search:', value);
  // Implement search logic here
};
</script>
<template>
  <div>
    <div>
      <Select
        v-model="value1"
        :size="size"
        style="width: 200px"
        :options="options"
      />
      <a-input-search
        v-model="value"
        placeholder="请输入客户编号或者名称，按回车键查询"
        style="width: 200px"
        @search="onSearch"
      />
    </div>
    <Table :data-source="dataSource" :columns="columns">
      <template #bodyCell="{ column }">
        <template v-if="column.key === 'operation'">
          <a-button type="primary">进账簿</a-button>
          <a-button type="primary">去报税</a-button>
        </template>
      </template>
    </Table>
  </div>
</template>
<style lang="less" scoped></style>
